package exam.bak.meituan;


import java.util.*;

public class P2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] params = Arrays.stream(scanner.nextLine().trim().split(" ")).mapToInt(s -> Integer.parseInt(s)).toArray();
        int n = params[0];
        int m = params[1];
        int q = params[2];
        //links
        int[][] links = new int[m][2];
        for (int i = 0; i < m; i++) {
            links[i] = Arrays.stream(scanner.nextLine().trim().split(" ")).mapToInt(s -> Integer.parseInt(s)).toArray();
        }
        //changes
        int[][] changes = new int[q][2];
        for (int i = 0; i < q; i++) {
            changes[i] = Arrays.stream(scanner.nextLine().trim().split(" ")).mapToInt(s -> Integer.parseInt(s)).toArray();
        }
        System.out.println(solve(n, m, q, links, changes));
    }

    // 地铁站数量,直接相连的地铁站数量,交换数量
    public static String solve(int n, int m, int q, int[][] links, int[][] changes) {
        TreeMap<Integer, Integer> map = new TreeMap<>();
        //初始站点
        for (int[] link : links) {
            // 左
            if (!map.containsKey(link[0])) {
                map.put(link[0], 0);
            }
            map.put(link[0], map.get(link[0])+1);
            // 右
            if (!map.containsKey(link[1])) {
                map.put(link[1], 0);
            }
            map.put(link[1], map.get(link[1])+1);
        }
        //交换
        for (int[] change : changes) {
            int set0 = map.get(change[0]);
            int set1 = map.get(change[1]);
            map.put(change[1], set0);
            map.put(change[0], set1);
        }
        //输出
        StringBuilder sb = new StringBuilder();
        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            sb.append(entry.getValue()).append(" ");
        }
        sb.deleteCharAt(sb.length() - 1);
        return sb.toString();
    }
}
